package com.android.djlmapp.adapter.msg;


import android.content.Context;
import android.widget.TextView;

import com.android.djlmapp.R;
import com.android.djlmapp.model.msg.InstationMsgModel;
import com.android.djlmapp.tools.TimeUtils;

import org.refresh_view.pullrecyclerview.BaseRecyclerAdapter;
import org.refresh_view.pullrecyclerview.BaseViewHolder;

import java.util.ArrayList;

/**
 * @Author wangziheng
 * @ProjectName djlm
 * @ClassName InstationMsgAdapter
 * @package com.android.djlmapp.adapter.msg
 * @data 2018/12/21 18:29
 * @Describe
 * @Change
 */
public class InstationMsgAdapter extends BaseRecyclerAdapter<InstationMsgModel.DataBean> {
    public InstationMsgAdapter(Context context) {
        super(context, R.layout.system_msg_list_item_layout, new ArrayList<>());
    }

    @Override
    protected void convert(BaseViewHolder holder, InstationMsgModel.DataBean item) {
        TextView msgTime = holder.itemView.findViewById(R.id.msg_list_time);
        holder.setText(R.id.msg_list_title,item.getMsg_title());
        String str = item.getUser_name()
                + "  " + TimeUtils.timedate(item.getAdd_time());
        msgTime.setText(str);
    }
}
